﻿using System;
using Gp.Scripts.Core;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Gp.Scripts.Data {
    public class ArmorEquip : EquipmentEntityConfig {
        // 护甲防御能力
        // [LabelText("护甲")] [VerticalGroup("数据/status")]
        // public int defence;
        [LabelText("护甲分块数")]
        [ProgressBar(0, 10, Segmented = true, DrawValueLabel = true)]
        [OnValueChanged("SetValue")]
        public int divisions = 1;

        [LabelText("护甲倍率")]
        public int armorRate = 1;
        
        


        [HideInInspector]
        public bool isBroken = false;

        
        public override string ItemName { get => itemName + (isBroken ? "(损坏)" : ""); set => itemName = value; }


# if UNITY_EDITOR

        private void SetValue() {
            divisions = Math.Max(1, divisions);
        }
#endif
    }
}